<template>
	<view class="content">
		<view class="title">商户中心</view>
		<view class="formWrapper">
			<input class="name input" placeholder="请输入用户名" v-model="username"></input>
			<input class="pwd input" type="password" placeholder="请输入密码" v-model="pwd"></input>
		</view>
		<view class="login" v-on:click="onLogin">立即登录</view>
	</view>
</template>

<script>
	import common from '../../common/common.js';
	import http from '../../common/http.js';
	
	export default {
		data() {
			return {
				title: 'Hello',
				username:'',
				pwd:''
			}
		},
		onLoad() {
			if (common.isLogin()) {
				uni.redirectTo({
					url:"../storelist/storelist"
				})
			}
		},
		methods: {
			onLogin () {
				common.loginIfNeed(this.username, this.pwd, (res)=>{
					console.log('=========')
					uni.redirectTo({
						url:"../storelist/storelist"
					})
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #f3f3f2;
	}
	.title {
		height: 150px;
		line-height: 180px;
		font-size: 28px;
		color: #7E7E7E;;
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 100%;
		
	}
	.formWrapper {
		width: 90%;
		position: relative;
	}
	.input {
		background-color: #f6f6f6;
		height: 44px;
		padding-left: 15px;
		border-radius: 15px;
		margin-top: 20px;
		
	}
	.pwd {

	}
	.login {
		margin-top: 40px;
		background-color: #75D7E0;
		color: white;
		border-radius: 25px;
		height: 50px;
		line-height: 50px;
		width: 90%;
		text-align: center;
		font-size: 18px;
	}
	#video-container {
		background-color: red;
		height: 100px;
		width: 100px;
	}
	.input {
		background-color: white;
		height: 48px;
		border-radius: 24px;
		margin-bottom: 40px;
	}
</style>
